import time

from selenium import webdriver
from selenium.webdriver.common import keys   #导入的是文件名 keys.py keys.Keys
from selenium.webdriver import ActionChains, Keys #导入的是类名
from selenium.webdriver.common.by import By

#创建浏览器驱动对象
driver=webdriver.Edge()
driver.maximize_window()
#你要测试的网址
driver.get("http://127.0.0.1:8848/pagetest/rega.html")

#账户
ele=driver.find_element(By.CSS_SELECTOR,"#userA")
ele.send_keys("1234567890")
time.sleep(1)
#全删除
#全选   ctrl+A  组合键
ele.send_keys(Keys.CONTROL,"a")
time.sleep(2)

ele.send_keys(Keys.BACKSPACE)  # 退格键
#键盘的操作


#让我们的程序休眠
time.sleep(5)
#浏览器驱动对象进行关闭
driver.quit()


